package com.example.controller;

import com.example.pojo.po.Role;
import com.example.service.impl.RoleServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/role")
public class RoleController {
    @Autowired
    private RoleServiceImpl service;

//    @PostMapping("/find")
//    public Result find(@RequestBody QueryPageBean queryPageBean) {
//        System.out.println("开始查找");
//        PageResult pageResult = service.selectByPage(queryPageBean);
//        return new Result(true, "查询成功", pageResult);
//    }
    @GetMapping("/find")
    public List find(){
        List<Role> allRoles = service.findAllRoles();
        return allRoles;
    }
}
